EqualCollections Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Determines if the two collections contain equal items in the same order. The passed instance of IEqualityComparer<T> is used for determining if two items are equal.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static bool EqualCollections<T>(
	IEnumerable<T> collection1,
	IEnumerable<T> collection2,
	IEqualityComparer<T> equalityComparer
)
Visual Basic (Declaration)
Public Shared Function EqualCollections(Of T) ( _
	collection1 As IEnumerable(Of T), _
	collection2 As IEnumerable(Of T), _
	equalityComparer As IEqualityComparer(Of T) _
) As Boolean
Visual C++
public:
generic<typename T>
static bool EqualCollections (
	IEnumerable<T>^ collection1, 
	IEnumerable<T>^ collection2, 
	IEqualityComparer<T>^ equalityComparer
)

Parameters

collection1
IEnumerable<(Of <T>)>
The first collection to compare.
collection2
IEnumerable<(Of <T>)>
The second collection to compare.
equalityComparer
IEqualityComparer<(Of <T>)>
The IEqualityComparer<T> used to compare items for equality. Only the Equals member function of this interface is called.

Return Value

True if the collections have equal items in the same order. If both collections are empty, true is returned.

Type Parameters

T
The type of items in the collections.

Exceptions

ExceptionCondition
System..::ArgumentNullExceptioncollection1, collection2, or equalityComparer is null.

See Also